 {
        
        var o = require("../UIManager/UISoundManager.js");
        cc.Class({
            extends: cc.Component,
            properties: {
                isEnterSelectScene: !1,
                _count: 0,
                _isDoBeforeEnterRoom: !1
            },
            onLoad: function () {
                Global.notificationCenter.on(Global.eventName.UPDATE_LOC_SUCCESSED, this.afterGetLoc.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.UPDATE_USERINFO_SUCCESSED, this.afterBindUserId.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.UPDATE_ROOMINFO_SUCCESSED, this.reConnectToRoom.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.GAME_TASKS, this.onGameTasks.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.LOAD_GAME_RESOURCE_SUCCESS, this.loadGameSourcesBack.bind(this), this),
                    Global.spriteAtlas.ctor(), this.loadingStartTime = cc.sys.now(), this.preloadScene();
                this._loadCallBack = null, console.info("==========加载界面开始==========", this.loadingStartTime),
                tywx.IsWechatPlatform() && wx.showLoading({
                    title: "正在登录..."
                });
            },
            onDisable: function () {
                console.log("loadingScene ondisable"), Global.notificationCenter.offAll(this), this && this.timer && clearTimeout(this.timer);
            },
            onDestroy: function () {
                Global.notificationCenter.offAll(this), this && this.timer && clearTimeout(this.timer);
            },
            start: function () {
                this.setLimitTimeAct();
            },
            setLimitTimeAct: function () {
                this && this.timer && clearTimeout(this.timer);
                this.timer = setTimeout(function () {
                    if (Global.spriteAtlas.getLoadPercent() < 100) {
                        var e;
                        e = function () {
                            console.log("----------加载资源失败--------- "), Global.SDK.exitGame();
                        };
                        var t = {
                            text: "加载游戏资源失败，跪求重新打开！",
                            confirmText: "确定",
                            confirmSp: Global.spriteAtlas.getOKSpf(),
                            confirmCallback: e
                        };
                        Global.UIPopupManager.alert(t);
                    }
                }, 1e5);
            },
            update: function (e) {
                var t = Global.spriteAtlas.getLoadPercent();
                t = t > 100 ? 100 : t;
                var n = Global.utils.formatNum(t, 2);
                n = Math.floor(n);
                if (t >= 100 && "正在进入 ", t >= 100 && 0 == this.isEnterSelectScene && Global.userProfile.getUserId() > 0) {
                    this.isEnterSelectScene = !0;
                    var o = cc.sys.now();
                    cc.info("==========加载界面总共用了" + (o - this.loadingStartTime) / 1e3 + "秒==========="),
                        cc.info("loadingScene userId：", Global.userProfile.getUserId());
                    this._isDoBeforeEnterRoom || this.beforeEnterRoom(), tywx.IsWechatPlatform() && wx.hideLoading();
                }
            },
            onGameTasks: function (e) {
                for (var t = 0; t < e.tasks.length; t++) {
                    "pop_tip" == e.tasks[t].action && this.gotoHall && this.gotoHall.call(this);
                }
            },
            afterBindUserId: function () {
                console.log("loadingScene beforeEnterRoom afterBindUserId:"), this._isHadBindUserId = !0;
            },
            afterGetLoc: function () {
                console.log("loadingScene beforeEnterRoom afterGetLoc:"), this._isHadGetLoc = !0;
            },
            beforeEnterRoom: function () {
                console.log("loadingScene beforeEnterRoom this._isHadBindUserId:", this._isHadBindUserId, this._isHadGetLoc),
                    this._isDoBeforeEnterRoom = !0, this.unscheduleAllCallbacks(), this.schedule(function () {
                    var e = this;
                    if (this._isHadBindUserId && this._isHadGetLoc) {
                        tywx.IsWechatPlatform() && wx.hideLoading(), this.unscheduleAllCallbacks(), this.gotoHall = function () {
                            this.playBGM(Global.userProfile.profile.ALLOW_SOUND_MUSIC), this.enabled = !1, this.node.removeComponent("loadController");
                        }.bind(this);
                        var t = Global.userProfile.getLoc();
                        if ("" != t || "[object Array]" === Object.prototype.toString.call(t) && 0 === t.length) {
                            console.log("loadingScene loc log 1:", t, Global.userProfile.isInGame());
                            var n = null, o = null, i = function (t) {
                                e._isMyRequst = !0, e._loadCallBack = function () {
                                    console.log("loadingScene gotoFriRoom:"), Global.msgHandler.requestJoinRoom(t);
                                }, Global.spriteAtlas.loadGameSpriteAtlas();
                            }.bind(this), a = function () {
                                e._isMyRequst = !0, e._loadCallBack = function () {
                                    console.log("loadingScene gotoGameRoom:"), Global.msgHandler.requestRoomList(this.playMode, this.gameId);
                                }, Global.spriteAtlas.loadGameSpriteAtlas();
                            }.bind(this);
                            if (Global.userProfile.isInGame()) {
                                console.log("======重新连接进入房间=======");
                                var r = Global.utils.parseLocInfo(t);
                                this.gameId = r[0], this.roomId = r[1], this.tableId = r[2], this.seatId = r[3],
                                    this.playMode = r[4], Global.SetGameId(this.gameId), n = 0 != this.roomId && 0 != this.tableId ? a : this.gotoHall;
                            } else Global.query && Global.query.extraInfo && Global.query.extraInfo[Global.config.QueryTag.inviteToFriRoom] ? (n = i,
                                o = Global.query.extraInfo.createRoomID) : n = this.gotoHall;
                            if (this.checkIsLogout()) Global.notificationCenter.emit(Global.eventName.GAME_SET_LOGOUT_CALLBACK, {
                                callback: n,
                                data: o
                            }); else if (n) {
                                n.call(this, o);
                                var s = cc.sys.now();
                                cc.info("==========加载场景到第二个场景总共用了" + (s - this.loadingStartTime) / 1e3 + "秒===========");
                            }
                        } else console.log("返回了user_info却没有loc字段，或者loc字段为null"), console.log("loadingScene loc log 2:", t),
                        this.gotoHall && this.gotoHall();
                    }
                }.bind(this), .2);
            },
            playBGM: function (e) {
                e && o.playMusic("my_hall_background_music", !0);
            },
            reConnectToRoom: function () {
                console.log("loadingScene reConnectToRoom:", this.playMode, this.roomId, this.tableId, this._isMyRequst),
                this.playMode && this.roomId && this.tableId && (this._isMyRequst ? (this._isMyRequst = !1,
                    this.playBGM(Global.userProfile.profile.ALLOW_SOUND_MUSIC), Global.msgHandler.requestQuickStart(this.playMode, this.roomId, this.tableId),
                cc.isValid(this.node) && (this.enabled = !1, this.node.removeComponent("loadController"))) : console.error("reConnectToRoom error is not my request"));
            },
            checkIsLogout: function () {
                return !!Global.netWork && Global.netWork.isLogout();
            },
            preloadScene: function () {
            },
            loadGameSourcesBack: function () {
                this._isMyRequst && this._loadCallBack && this._loadCallBack();
            }
        })
    }